<?php

namespace App\Models;


use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

/**
 * Class UserDevice - 用户设备
 *
 * @package App\Models
 */
class UserDevice extends Model
{
    protected $table = 'user_devices';

    protected static $unguarded = true;

    protected $casts = [
        'user_id'   => 'int',
        'device_id' => 'int',
    ];

    /**
     * 对应请求的多语言描述
     */
    public function device(): BelongsTo
    {
        return $this->belongsTo(Device::class, 'device_id', 'id');
    }
}
